﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Simulator.RefPumpService;

namespace Simulator
{
    //there is nothing to do with this file now. Some methods, maybe will be used in future
    class Try
    {
        private Dictionary<int, List<double>> divideDictionaty; 
        private PumpServiceClient _client;
        public Try()
        {
            _client = new PumpServiceClient();
            divideDictionaty = new Dictionary<int, List<double>>();
        }


        void GetAllStation()
        {
            List<double> levelList;
            foreach (Station station in _client.RequestCurrentStatusForAll())
            {
                levelList = new List<double>();
                int count = PumpCount(station.Id);
                for (int i = 1; i <= count; i++)
                {
                    levelList.Add(Math.Round((1 / count * station.WaterLevel), 2)); 
                }
                divideDictionaty[station.Id] = levelList;
            }
            
        }

        int PumpCount(int stationId)
        {
            return _client.RequestCurrentStatus(stationId).Count();
        }
    }


}
